import formBuilder from "@/comps/form/formBuilder";
import api from "./api";
import apiCat from "../../ItemCategory/js/api";
import apiUnit from "../../Unit/js/api";

export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addText("name").setSpan(3).setLabel("名称")
        fb.addCascade("categoryId","分类",3).setApi(apiCat.urlTree)
        fb.addSelect("unitId","单位",3).setApi(apiUnit.urlChoice)
        fb.addText("version").setSpan(3).setLabel("版本").setTypeNumber()

        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}